//
//  BaseService.h
//  LotteryClient
//
//  Created by SunYu on 14-2-6.
//  Copyright (c) 2014年 SunYu. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "BaseResponse.h"
#import "BaseResquest.h"
#import "BaseEntity.h"

#import "NetManager.h"
#import "NSString+BaseFramework.h"
#import "NSDictionary+BaseFramework.h"
#import "AFHTTPRequestOperation.h"

#define SERVE_KEY_CHANNEL_ID @"sid"

#define SERVE_KEY_PLATFORM @"platform"

#define SERVE_KEY_SCREEN_WITH @"width"

#define SERVE_KEY_SCREEN_HEITHT @"height"

#define SERVE_KEY_SYSTEM_VERSION @"sysVer"

#define SERVE_KEY_APP_VERSION @"softVer"

#define SERVE_KEY_DEVICE_ID @"machId"

#define SERVE_KEY_COMMAND @"cmd"

#define SERVE_KEY_MESSAGE @"msg"

#define SERVER_MESSAGE_ENCRYPT_SUFFIX_STRING @"kkdYJjaMBSqEp6NLepGTxz2uyHn5t995uRARe2rbi8V7"

#define SERVE_KEY_ENCRYPT @"md5"

#define SERVE_KEY_METHOD @"func"

#define kUploadFileKey @"kUploadFileKey"

#define kDefaultPageSize 20

typedef void(^RequestFinishBlock)(BaseResponse *response);

@interface BaseService : Base
{
	
}
AS_STATIC_PROPERTY_INT(baseType)
@property(nonatomic, strong) NSMutableDictionary *requsetDictionary ;

- (void)setWrapper:(AFHTTPRequestOperation *)wrapper ForKey:(NSString *)key;
- (void)removeWrapperForKey:(NSString *)key;

@property(nonatomic, strong) NSString *baseUrlString ;

#pragma --
#pragma --mark init
- (instancetype)initDefaultBaseUrlString;

+ (instancetype)serviceWithDefaultBaseUrlString;

- (instancetype)initWithBaseUrlString:(NSString *)baseUrlString;

+ (instancetype)serviceWithBaseUrlString:(NSString *)baseUrlString;

#pragma --
#pragma --mark customer
- (NSMutableDictionary *)defaultRequestParameterDictionary;




- (AFHTTPRequestOperation *)beginRequestWithRelativePath:(NSString *)relativePath
										 parameterObject:(id)object
										   responseClass:(NSString *)className
											 finishBlock:(RequestFinishBlock)finishBlock;

- (AFHTTPRequestOperation *)beginGetRequestWithRelativePath:(NSString *)relativePath
											parameterObject:(id)object
											  responseClass:(NSString *)className
												finishBlock:(RequestFinishBlock)finishBlock;


- (AFHTTPRequestOperation *)beginUploadWithRelativePath:(NSString *)relativePath
											 imageArray:(NSArray *)imageArray
										  responseClass:(NSString *)className
											finishBlock:(RequestFinishBlock)finishBlock;


- (AFHTTPRequestOperation *)beginUploadWithRelativePath:(NSString *)relativePath
											 imageArray:(NSArray *)imageArray
											  otherPara:(NSDictionary *)dictionary
										  responseClass:(NSString *)className
											finishBlock:(RequestFinishBlock)finishBlock  ;



@end
